﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace BlackBird.Models
{
	/// <summary>
	/// 比价单的状态
	/// </summary>
	public enum BiJiaDanStatus
	{
		Create = 0,  //创建状态
		//Submit = 1,  //等待提交审核
		ShengHe = 2, //审核
		//Preview = 3  //
        Complete = 3
	}

    public enum PriceType
    {
        [Description("固定价格")]
        FixPrice = 0, //固定价格

        [Description("浮动价格")]
        FloatPrice = 1, //浮动价格
    }

    /// <summary>
    /// 采购类别
    /// </summary>
    public enum ContractType
    {
        [Description("签订物理合同")]
        PhysicalContract = 0, //签订物理合同
        [Description("不需签订物理合同")]
        NonPhysicalContract = 1 //不需签订物理合同
    }

    /// <summary>
    /// 采购方式
    /// </summary>
    public enum PurchaseType
    {
        [Description("集团采购")]
        CompanyPurchase = 0, //集团采购
        [Description("常规采购")]
        NormalPurchase = 1, //常规采购
    }

    /// <summary>
    /// 专业类别
    /// </summary>
    public enum BusinessGroup
    {
        [Description("集团土建组")]
        BuildingGroup = 0, //集团土建组
        [Description("集团装饰组")]
        DecorateGroup = 1, //集团装饰组
        [Description("集团水电组")]
        WaterElectricGroup = 2, //集团水电组
        [Description("常规土建组")]
        NormalBuildingGroup = 3, //常规土建组
        [Description("常规其他组")]
        OtherGroup = 4, //常规其他组
    }

    /// <summary>
    /// 是否预算部核价
    /// </summary>
    public enum BudgetDepartmentCheck
    {
        [Description("否")]
        No = 0,
        [Description("是")]
        Yes = 1,
    }

	public class BiJiaDanDM
    {
        #region Basic Information
        public BiJiaDanDM()
		{
			Comments = new List<CommentDM>();
			PriceType = PriceType.FixPrice;
			ContractType = Models.ContractType.PhysicalContract;
			PurchaseType = Models.PurchaseType.CompanyPurchase;
			BusinessGroup = Models.BusinessGroup.BuildingGroup;
			BudgetDepartmentCheck = Models.BudgetDepartmentCheck.No;
		}

        public string Name { get; set; }

		public string BianHao { get; set; }

		public string Id { get; set; }

        public string ParentId { get; set; }

		public string CreateUser_idUser { get; set; }

        public string CreateUserName { get; set; }

        public DateTime Date { get; set; }

		//Status + ProcessStep 决定了审核的流程
		//当Status == Shenhezhong 时，ProcessStep决定
		//了审核的流程
        public SupportTypeStatus Status { get; set; }

        //wql:应该是StepNumber??
        //而非ProcessStep,数据库中ProcessStep有别的意思
		public int CurrentStepNumber { get; set; }

        #endregion

        #region Bijiadan Top
        /// <summary>
        /// 是否价格浮动
        /// </summary>
        public PriceType PriceType { get; set; }

        /// <summary>
        /// 采购类别
        /// </summary>
        public ContractType ContractType { get; set; }

        /// <summary>
        /// 采购方式
        /// </summary>
        public PurchaseType PurchaseType { get; set; }

        /// <summary>
        /// 专业类别
        /// </summary>
        public BusinessGroup BusinessGroup { get; set; }

        /// <summary>
        /// 是否预算部核价
        /// </summary>
        public BudgetDepartmentCheck BudgetDepartmentCheck  { get; set; }
        #endregion

        public BiJiaDanTableDM table { get; set; }

        #region Bijiadan Bottom
        /// <summary>
        /// 厂商及技术备注【项目填写】
        /// </summary>
        [DataType(DataType.MultilineText)]
        public string TechComment_Project {get; set;}

        /// <summary>
        /// 厂商及技术备注【中心填写】
        /// </summary>
        [DataType(DataType.MultilineText)]
        public string TechComment_Center {get; set;}
        #endregion

        #region Attachments & Comments
		public AttachedFileList AttachedFileList { get; set; }

        public List<CommentDM> Comments { get; set; }

		public CommentDM CurrentPostComment { get; set; }
        #endregion
    }
}